#include <stdio.h>

int main()
{

    FILE *f = fopen("D:\\vscode-workplace\\first\\otther\\test.test", "rt");
    if (f == NULL)
    {
        printf("打开失败");
    }

    char buff[1024];
    printf("fscanf:\n ");
    while (fscanf(f, "%s", buff) != -1)
    {
        printf("%s\n", buff);
    }

    printf("\nfgetc:\n");
    rewind(f);
    int i;
    while ((i = fgetc(f)) != EOF)
    {
        printf("%c", i);
    }

    printf("\nfgets\n");
    rewind(f);
    while (fgets(buff, 1024, (FILE *)f) != NULL)
    {
        printf("%s", buff);
    }

    fclose(f);
}